# -*- codeing = utf-8 -*-
# @Time : 2021/2/27 22:49
# @Atuthor: 朱朱
# @File: 146finally关键字的使用.py
# @Software: PyCharm


try:
    f = open('xxx.txt', 'rb')
    while True:
        content = f.read(1024)
        if not content:
            break
        print(content)
except Exception as e:
    print(e)
finally: # 最终都会执行的代码
    print('文件被关闭了')

